<?php

    include '../phpFunctions/databaseConnect.php';
    $actCheck = (isset($_GET['check']))?$_GET['check']:0;
    $anvandarnamn = (isset($_GET['user']))?$_GET['user']:0;
    $result = mysql_query("select activationkey from users where username ='$anvandarnamn'");
    while($row = mysql_fetch_assoc($result)) {
	$activationkey = $row["activationkey"];
	}

         if ($actCheck == $activationkey ){
          $query = "UPDATE users
          SET activationkey = '', status = 'Active'
          WHERE username = '$anvandarnamn'";
          mysql_query($query);
          mysql_close();
            }

include '../InsertUser/registersuccess.php';

?>
